package elmar.swt;

import java.util.ArrayList;
import java.util.List;
import junit.framework.TestCase;

public class BinTreeCoordinateHelperTest extends TestCase {

	public void testGetPosX(){
		assertEquals(0,BinTreeCoordinateHelper.getPosX(0));
		assertEquals(0,BinTreeCoordinateHelper.getPosX(1));
		assertEquals(1,BinTreeCoordinateHelper.getPosX(2));
		assertEquals(0,BinTreeCoordinateHelper.getPosX(3));
		assertEquals(1,BinTreeCoordinateHelper.getPosX(4));
		assertEquals(2,BinTreeCoordinateHelper.getPosX(5));
		assertEquals(3,BinTreeCoordinateHelper.getPosX(6));
		assertEquals(0,BinTreeCoordinateHelper.getPosX(7));
	}
	
	public void testGetPosY(){
		assertEquals(0,BinTreeCoordinateHelper.getPosY(0));
		assertEquals(1,BinTreeCoordinateHelper.getPosY(1));
		assertEquals(1,BinTreeCoordinateHelper.getPosY(2));
		assertEquals(2,BinTreeCoordinateHelper.getPosY(3));
		assertEquals(2,BinTreeCoordinateHelper.getPosY(4));
		assertEquals(2,BinTreeCoordinateHelper.getPosY(5));
		assertEquals(2,BinTreeCoordinateHelper.getPosY(6));
		assertEquals(3,BinTreeCoordinateHelper.getPosY(7));
	}
	public void testGetNHalfUnit(){
		assertEquals(0,BinTreeCoordinateHelper.getNHalfUnitX(0));
		assertEquals(0,BinTreeCoordinateHelper.getNHalfUnitX(1));
		assertEquals(1,BinTreeCoordinateHelper.getNHalfUnitX(2));
		assertEquals(2,BinTreeCoordinateHelper.getNHalfUnitX(3));
		assertEquals(3,BinTreeCoordinateHelper.getNHalfUnitX(4));
		assertEquals(3,BinTreeCoordinateHelper.getNHalfUnitX(5));
		assertEquals(3,BinTreeCoordinateHelper.getNHalfUnitX(6));
		assertEquals(4,BinTreeCoordinateHelper.getNHalfUnitX(7));
		assertEquals(5,BinTreeCoordinateHelper.getNHalfUnitX(8));
	}

    public static void main(String[] _argv){
        List<String> l = new ArrayList<String>();
        String s = l.get(0);
    }
}
